import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.pylab import *
import warnings
warnings.filterwarnings('ignore')

df=pd.read_csv('train_titanic.csv')

s0=df['Sex'][df['Survived']==0].value_counts()
s1=df['Sex'][df['Survived']==1].value_counts()

df1=pd.DataFrame({'获救':s1,'未获救':s0})
df1.plot(kind='bar')
plt.show()